<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" href="../../css/api.css" />
    <link rel="stylesheet" href="../../css/common.css" />
    <style>
        html, body {
          width: 100%;
          height: 100%;
        }
    </style>
</head>

<body>
    <iframe id="frame" allow="autoplay; fullscreen; microphone" allowfullscreen="allowfullscreen" width="100%" height="100%" frameborder="0"></iframe>
</body>
<script src="../../script/api.js"></script>
<script>
    var deviceReady = false
    var videoPath

    apiready = function() {
        deviceReady = true
        init()
    }

    function init() {
        if (!deviceReady) {
            alert('apiready is false')
            play('http://223.111.192.83:8100/stream/channels/6f0ff7bbe09d4818813cd3d319d386e9/sub')
        }

        videoPath = api.pageParam.videoPath
        play(videoPath)
    }



    function play(videoPath) {
        var iframeDom = document.getElementById('frame')
        $api.attr(iframeDom, 'src', videoPath)
    }
</script>

</html>
